<%@ page language="java" contentType="text/html; charset=utf-8"
    import="com.vo.*,com.dao.*,com.daoimpl.*,java.util.*"
    pageEncoding="utf-8"%>
    <%@taglib uri="http://jsptags.com/tags/navigation/pager" prefix="pg"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body>
	<%@ include file="navi.jsp" %>
	<h2><span>所有用户信息</span></h2>
	
	<%
	//使用pager javabean的要求：
	//ArrayList list中存放了所有的用户对象
	//list存放在session中
	%>
	
	<pg:pager maxPageItems="7" url="alluser.jsp">
		<table>
			<tr>
				<td>用户ID</td><td>用户名</td>
				<td>密码</td><td>用户类型</td>
				<td>操作</td>
			</tr>
			<c:forEach items="${sessionScope.list}" var="user1">
				<pg:item>
					<tr>
						<td>${user1.id}</td><td>${user1.username}</td>
						<td>${user1.password}</td><td>${user1.type}</td>
						<td><a href="FindUserByIdServlet?id=${user1.id}">修改用户</a>
						<a href="DeleteUserServlet?id=${user1.id}">删除用户</a></td>
					</tr>
				</pg:item>
			</c:forEach>
			<tr>
				<td  colspan="5">
					<pg:index>
						<pg:first><a href="${pageUrl }">第一页</a></pg:first>
						<pg:prev><a href="${pageUrl}">上一页</a></pg:prev>
						<pg:pages>
							<a href="${pageUrl}">[${pageNumber }]</a>
						</pg:pages>
						<pg:next><a href="${pageUrl}">下一页</a></pg:next>
						<pg:last><a href="${pageUrl }">最后一页</a></pg:last>
					</pg:index>
				</td>
			</tr>
		</table>
	</pg:pager>

	<%@ include file="foot.jsp" %></body>
</html>
